import axios from "axios"
export const getWaterfallData = async (num: number = 10) => {
    return await axios.get('https://api.thecatapi.com/v1/images/search?limit=' + num)
}

export const getWaterfallData2 = async (num: number = 10) => {
    // 区间在200-500之间的随机数
    const width = () => Math.floor(Math.random() * (500 - 200) + 200)
    const height = () => Math.floor(Math.random() * (500 - 200) + 200)
    const q = []
    for (let i = 0; i < num; i++) {
        q.push({ url: `https://picsum.photos/${width()}/${height()}` })
    }
    return q
}